<?php

/**
 * tblOrders filter form base class.
 *
 * @package    travis
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasetblOrdersFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'user_id'            => new sfWidgetFormFilterInput(),
      'provider_id'        => new sfWidgetFormFilterInput(),
      'provider_order'     => new sfWidgetFormFilterInput(),
      'main_first_name'    => new sfWidgetFormFilterInput(),
      'main_last_name'     => new sfWidgetFormFilterInput(),
      'from_date'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'to_date'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'hotel_id'           => new sfWidgetFormFilterInput(),
      'rooms_id'           => new sfWidgetFormFilterInput(),
      'guest_names'        => new sfWidgetFormFilterInput(),
      'children'           => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'children_names'     => new sfWidgetFormFilterInput(),
      'children_ages'      => new sfWidgetFormFilterInput(),
      'type_price'         => new sfWidgetFormFilterInput(),
      'payment_type'       => new sfWidgetFormFilterInput(),
      'amount'             => new sfWidgetFormFilterInput(),
      'commissions'        => new sfWidgetFormFilterInput(),
      'status'             => new sfWidgetFormFilterInput(),
      'cancellation'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'cancellation_date'  => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'agent_cancellation' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'create_by'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'user_id'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'provider_id'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'provider_order'     => new sfValidatorPass(array('required' => false)),
      'main_first_name'    => new sfValidatorPass(array('required' => false)),
      'main_last_name'     => new sfValidatorPass(array('required' => false)),
      'from_date'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'to_date'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'hotel_id'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rooms_id'           => new sfValidatorPass(array('required' => false)),
      'guest_names'        => new sfValidatorPass(array('required' => false)),
      'children'           => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'children_names'     => new sfValidatorPass(array('required' => false)),
      'children_ages'      => new sfValidatorPass(array('required' => false)),
      'type_price'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'payment_type'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'amount'             => new sfValidatorPass(array('required' => false)),
      'commissions'        => new sfValidatorPass(array('required' => false)),
      'status'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'cancellation'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'cancellation_date'  => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'agent_cancellation' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'create_by'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('tbl_orders_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'tblOrders';
  }

  public function getFields()
  {
    return array(
      'id'                 => 'Number',
      'user_id'            => 'Number',
      'provider_id'        => 'Number',
      'provider_order'     => 'Text',
      'main_first_name'    => 'Text',
      'main_last_name'     => 'Text',
      'from_date'          => 'Date',
      'to_date'            => 'Date',
      'hotel_id'           => 'Number',
      'rooms_id'           => 'Text',
      'guest_names'        => 'Text',
      'children'           => 'Boolean',
      'children_names'     => 'Text',
      'children_ages'      => 'Text',
      'type_price'         => 'Number',
      'payment_type'       => 'Number',
      'amount'             => 'Text',
      'commissions'        => 'Text',
      'status'             => 'Number',
      'cancellation'       => 'Boolean',
      'cancellation_date'  => 'Date',
      'agent_cancellation' => 'Date',
      'create_by'          => 'Date',
    );
  }
}
